<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示/隐藏</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <div v-if="flag">最牛div1</div>
    <div v-show="flag">最牛div2</div>
    <input type="button" @click="logger()" value="开关">

</div>


<script type="application/javascript">
    var vue = new Vue({
        el:'#app',
        data:{
            flag: true,
        },
        methods:{
          logger(){
              this.flag=!this.flag;
          }
        }
    });


</script>

</body>
</html>